package com.hxkj.client.service;

import com.hxkj.domain.po.LoginToken;
import com.hxkj.domain.po.Token;
import com.platform.common.domain.result.ResultDataStruct;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * created by kezhijie on 2018/8/31 14:52.
 * email to kezhijie@hxoss.com
 */
@FeignClient(name = "cms-user-center")
public interface TokenServiceClient extends BaseClient {

    @RequestMapping(value = "/token/refresh", method = RequestMethod.GET, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    ResultDataStruct<LoginToken> refresh(@RequestParam("token") String token);

    @RequestMapping(value = "/token/validate", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    ResultDataStruct<Token> validate(@RequestBody String accessToken);
}
